gusucode.com > 耐品图片管理系统 标准版A > 耐品图片管理系统 标准版A/Admin_Upload_0.asp

    <!--#include file="Admin_ChkPurview1.asp"-->
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
Behind.WriteHtmlHead

Dim UploadNum

UploadNum = Netout.CheckNumeric(Request.Cookies("UploadNum"))

Dim i,ExifInfo(5)
For i = 0 to 5
	ExifInfo(i) = ""
Next

Dim Rs
Set Rs = Server.CreateObject("adodb.recordset")

Dim PhotoCount
PhotoCount = Netout.CheckNumeric(Trim(Request.QueryString("PhotoCount")))
If PhotoCount = 0 Then PhotoCount = 1
%>
<script language="javascript">
<!--
var $ = document.getElementById;
var intPhotoCount = <%=PhotoCount%>;
var parentForm = parent.document.form1;

function SendData(obj){
	if(parentForm.ClassId.selectedIndex==0){
		alert('请选择一个分类!');
		parentForm.ClassId.focus();
		return false;
	}
	if(parentForm.ManuName.value==""){
		alert('请填写图片署名!');
		parentForm.ManuName.focus();
		return false;
	}
	obj.ManuName.value = parentForm.ManuName.value;
	
	var canup = false;
	for(var i=1;i<=intPhotoCount;i++){
		if($("ImageInfo0_"+i).value!=""){
			canup = true;
		}
	}
	if(canup){
		obj.btnUpload.value = "正在上传图片,请稍候...";
		obj.btnUpload.disabled = true;
		obj.btnReset.disabled = true;
		obj.action = "Admin_UploadFile.asp";
		obj.submit();
		return true;
	}else{
		alert("请选择要上传的图片!");
		return false;
	}
}
function PreviewImage(index){
	var filepath = photoup.elements["ImageInfo0_"+index].value;
	if(filepath!="") $("PreviewRow_"+index).innerHTML='<img src="'+filepath+'" width=150 align="absbottom">';
}
function UpdateSize(rows,objName){
	var area = $(objName);
	if(rows>0) area.rows += rows;
	else if(rows<0&&area.rows>=8) area.rows += rows;
}
//-->
</SCRIPT>
<script language="vbscript">
Function TrueDate(datestr)
	TrueDate = IsDate(datestr)
End Function
</script>
<script language="javascript" src="Inc/Pop.js"></script>
<body topmargin="0" leftmargin="0">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form action="" method="post" name="photoup" enctype="multipart/form-data" onSubmit="return SendData(this);">
    <input type="hidden" name="IsMaitu" value="0">
    <input type="hidden" name="ManuName" id="ManuName" value="">
    <input type="hidden" name="PhotoCount" id="PhotoCount" value="<%=PhotoCount%>">
    <%
	Dim RowIndex
	For RowIndex = 1 To PhotoCount
	%>
    <tr>
      <td width="162" class="tdbg" id="PreviewRow_<%=RowIndex%>" valign="top" align="right">&nbsp;</td>
      <td>
        <table width="100%" border="0"  cellpadding="2" cellspacing="1" class="border" style="border-bottom: 3px solid #666666;">
          <tr>
            <td width="130" align="right" class="tdbg">上传图片<%=RowIndex%></td>
            <td width="900" class="tdbg">
              <input name="ImageInfo0_<%=RowIndex%>" type="file" id="ImageInfo0_<%=RowIndex%>" onChange="javascript:PreviewImage(<%=RowIndex%>);" size="45" align="baseline">
            </td>
          </tr>
          <tr>
            <td width="130" align="right" valign="top" class="tdbg">图片说明</td>
            <td class="tdbg">
              <textarea name="ImageInfo1_<%=RowIndex%>" rows="5" cols="54" id="ImageInfo1_<%=RowIndex%>"></textarea>
              <br>
              <a href="javascript:UpdateSize(-3,'ImageInfo1_<%=RowIndex%>')"><img src="images/minus.gif" unselectable="on" border='0'></a> <a href="javascript:UpdateSize(3,'ImageInfo1_<%=RowIndex%>')"><img src="images/plus.gif" unselectable="on" border='0'></a> </td>
          </tr>
<%
If Not Purchase Is Nothing Then
	Purchase.ShowUploadLine RowIndex
End If
%>
		  <input type="hidden" name="ImageInfo7_<%=RowIndex%>" value="0">
        </table>
      </td>
    </tr>
    <%
	Next
	%>
    <tr>
      <td class="tdbg">&nbsp;</td>
	  <td>
        <table width="100%" border="0"  cellpadding="2" cellspacing="1" class="border">
          <tr>
            <td class="tdbg" width="104">&nbsp;</td>
            <td class="tdbg">
              <input name="btnUpload" type="submit" value="立即上传" >
              <input name="btnReset" type="reset" id="btnReset" value="重新填写" >
            </td>
          </tr>
        </table>
      </td>
	</tr>
  </form>
</table>
</body>
</html>